-
Notifications
You must be signed in to change notification settings - Fork 713
SONARJAVA-4960 False positive for S1854 #5378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
19d09dc to
947f918
Compare
|
This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically |
| } | ||
|
|
||
| @Test | ||
| void test_fp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test name should be more precise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proposed test_incomplete_semantic as a more precise name in my last commit
...-checks-test-sources/default/src/main/files/non-compiling/checks/UnusedVariablesFPCheck.java
Show resolved
Hide resolved
...-checks-test-sources/default/src/main/files/non-compiling/checks/UnusedVariablesFPCheck.java
Outdated
Show resolved
Hide resolved
| assertThat(unknownSymbol.isPackageSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isTypeSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isVariableSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isMethodSymbol()).isFalse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't read this carefully, but I'm wondering why this is removed instead of reverting the condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit :
this line 174 is inside of function private static void assertCommonProperties(Symbol unknownSymbol) which is used by all kinds of unknown symbols tests (unknown_type_symbol, unknown_method_symbol, ...), the isMethodSymbol function is no longer final in the parent abstact class UnknownSymbol , the result can be overriden differently in each child class (UnkownTypeSymbol, UnknownMethodSymbol).
|




Uh oh!
There was an error while loading. Please reload this page.